#include "Server.hpp"
#include "IoService.hpp"
#include "NetCal.hpp"
#include<memory>
#include <jsoncpp/json/json.h>

int main(int argc, char*argv[])
{
	if(argc!=2)
	{
		std::cerr<<"Usage:"<<argv[0]<<"local port"<<std::endl;
		exit(0);
	}
	uint16_t port =stoi(argv[1]);
	IoService ioser(NetCal::Calculator);//符合IO三层模型
	service_t service = std::bind(&IoService::Execute,&ioser,std::placeholders::_1,std::placeholders::_2);
	unique_ptr<Server> s = make_unique<Server>(port,service);
	s->Start();
};
